Skip to content

Added better error message for OIDC error #5433

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

trwalke
Copy link
Member

@trwalke trwalke commented Aug 11, 2025

Fixes #
Fix for #4676

Changes proposed in this request
Adding better message for OICD errors

Testing

Performance impact

Documentation

  • All relevant documentation is updated.

@trwalke trwalke requested a review from a team as a code owner August 11, 2025 08:09
{
var handler = new MockHttpMessageHandler()
{
ExpectedUrl = authority + "oauth2/v2.0/token",
ExpectedUrl = expectedUrl != null? expectedUrl : $"{authority}oauth2/v2.0/token",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: space between "null" and "?"

Comment on lines +234 to +236
public const string AadAccountTypeAndResourceIncompatibleErrorCode = "AADSTS500207";
public const string AadMissingScopeErrorCode = "AADSTS900144";

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can't you re-use the constants from src/client/Microsoft.Identity.Client/Internal/Constants.cs? Wouldn't that be better?

.Build();

httpManager.AddMockHandler(
CreateOidcHttpHandler(authority + "/" + Constants.WellKnownOpenIdConfigurationPath));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: I know you said you didn't want to use string interpolation for just one string character, but I think we should try to be consistent.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants